package com.platform.dao;

import com.platform.entity.GoodsVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author lipengjun
 * @email 939961241@qq.com
 * @date 2017-08-11 09:16:45
 */
public interface ApiGoodsMapper extends BaseDao<GoodsVo> {
    //中大团队扩展
    GoodsVo queryObjectWithLevel(Map<String, Object> params);

    List<GoodsVo> queryHotGoodsList(@Param("root_dept_id") Integer root_dept_id, @Param("access_user_grade") Integer access_user_grade, @Param("offset") Integer offset, @Param("limit") Integer limit);

    List<GoodsVo> queryCategoryList(@Param("root_dept_id") Integer root_dept_id, @Param("access_user_grade") Integer access_user_grade, @Param("categoryIds") List categoryIds);

    List<GoodsVo> queryGoodsList(@Param("good_id") Integer good_id);

    List<GoodsVo> queryCatalogProductList(Map<String, Object> params);

    List<GoodsVo> queryListBySameCategory(Map<String, Object> params);

    //中大团队扩展
    int queryTotalByDeptId(Map<String, Object> params);

    List<GoodsVo> queryNewGoodsList(@Param("root_dept_id") Integer root_dept_id, @Param("access_user_grade") Integer access_user_grade, @Param("offset") Integer offset, @Param("limit") Integer limit);

    List<GoodsVo> queryCollageGoodsList(@Param("root_dept_id") Integer root_dept_id, @Param("access_user_grade") Integer access_user_grade, @Param("now") Date now, @Param("offset") Integer offset, @Param("limit") Integer limit);

    List<GoodsVo> queryFuturesGoodsList(@Param("root_dept_id") Integer root_dept_id, @Param("access_user_grade") Integer access_user_grade, @Param("now") Date now, @Param("offset") Integer offset, @Param("limit") Integer limit);

    /**
     * 中大团队扩展
     * 根据父类ID获取相关商品列表
     * @param map
     * @return
     */
    List<GoodsVo> queryListCascade(Map<String, Object> map);

    int updateCollageNum(GoodsVo goodsVo);
}
